﻿<UserControl xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:views="clr-namespace:GiveAQuiz.QuizManager.Views"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
             xmlns:controlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
             x:Class="GiveAQuiz.QuizManager.QuizEditor"
             mc:Ignorable="d"
             FontFamily="Trebuchet MS"
             FontSize="14"
             Width="900"
             Height="650">
  <Grid x:Name="LayoutRoot"
        Background="White">
    <Grid.ColumnDefinitions>
      <ColumnDefinition />
      <ColumnDefinition Width="300" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"
                     MinHeight="49" />
      <RowDefinition />
      <RowDefinition Height="Auto"
                     MinHeight="25" />
    </Grid.RowDefinitions>
    <Image Margin="-207,0,-58,-167" Grid.RowSpan="3" Source="images/background-pencil.jpg" Stretch="Fill" Grid.ColumnSpan="2" Opacity="0.3" d:IsLocked="True"/>

    <TextBlock Margin="8"
               TextWrapping="Wrap"
               Text="{Binding QuizDefinition.QuizName}"
               FontSize="32" />
    <StackPanel Margin="8"
                HorizontalAlignment="Right"
                Grid.Column="1"
                Orientation="Horizontal">
      <Button Content="Edit Quiz Details"
              Command="{Binding EditInfoCommand}" />
    </StackPanel>
    <views:EditorView Grid.Row="1"
                      Margin="2" />
    <views:ToolbarView Grid.Row="1"
                       Grid.Column="1"
                       Margin="2" />
    <TextBlock Foreground="Red"
               FontWeight="Bold"
               Text="{Binding ErrorMessage}"
               TextWrapping="Wrap"
               Grid.Row="2" />
    <StackPanel Grid.Row="2"
                Grid.Column="1"
                Orientation="Horizontal"
                HorizontalAlignment="Right"
                Margin="8">
      <Button Content="Cancel Quiz"
              Margin="2"
              Command="{Binding CancelCommand}" />
      <Button Content="Save Quiz"
      	Margin="2"
      	Command="{Binding SaveCommand}" />
    </StackPanel>
    <controlsToolkit:BusyIndicator IsBusy="{Binding IsBusy}"
                           BusyContent="Please Wait..."
                           Grid.RowSpan="3"
                           Grid.ColumnSpan="2" d:IsLocked="True" />

  </Grid>
</UserControl>
